﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.Net;

namespace Spore.Utils
{
    //public class NetService
    //{
    //    ClientLister listener;
    //    public NetService()
    //    {

    //    }

    //    public void Open()
    //    {

    //    }

    //    private void InitListener()
    //    {
    //        Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
    //        socket.Bind(new IPEndPoint(IPAddress.Loopback, 8066));
    //        listener = new ClientLister(socket);
    //        listener.ReadDataCompeletedEventHandle += new Action<ChannelBase<Socket>>(listener_ReadDataCompeletedEventHandle);
    //        listener.Open();
    //    }

    //    void listener_ReadDataCompeletedEventHandle(ChannelBase<Socket> obj)
    //    {
    //        Socket[] sockets = obj.BufferReader.GetAndRemoveAllElement();
    //        foreach (var v in sockets)
    //        {
    //            Loger.Info(string.Format("读入一个连接,远程IP:{0}", v.RemoteEndPoint.ToString()));
    //            NetClient nc = new NetClient(v, DTOTypeConverter.Instance);
                
    //        }
    //    }
    //}
}
